/**
 * Copyright (c) 2013 onionframework.org
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 */
package org.onionframework.servlet;

import java.util.Set;

import javax.servlet.ServletContainerInitializer;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;

import org.springframework.web.context.request.RequestContextListener;
import org.springframework.web.util.IntrospectorCleanupListener;

/**
 * @author allan
 *
 */
public class OnionServletContainerInitializer implements
		ServletContainerInitializer {

	@Override
	public void onStartup(Set<Class<?>> classes, ServletContext servletContext)
			throws ServletException {
		ServletContexts.setServletContext(servletContext);
		servletContext.addListener(IntrospectorCleanupListener.class);
		servletContext.addListener(RequestContextListener.class);
	}

}
